<template>
	<view class="banner">
		<swiper class="swiper" :indicator-dots="false" autoplay circular>
			<swiper-item v-for="(item, index) in list" :key="index" @click="handleView(item)">
				<image class="img" :src="item.image"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				require: true,
			},
		},
		data() {
			return {}
		},
		methods: {
			handleView(item) {
				// console.log(item);
				uni.navigateTo({
					url: `/pages/view/index?id=${item.url}`
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.banner {
		background-color: #fff;

		.swiper {
			height: 300px;
		}

		.img {
			width: 100%;
			display: block;
			height: 100%;
		}
	}
</style>